//
// Created by Administrator on 2023-5-25
//

#include <iostream>
#include <vector>
#include "arrUtil.h"
using namespace std;

void bubble(int *a,int l)
{
    for (int j = 0; j < l-1; ++j)
    {
        for (int i = 0; i < l-j-1; ++i)
        {
            if(a[i] > a[i + 1])
            {
                swap(a[i], a[i + 1]);
            }
        }
//        printArr(a,l);
    }
}
int main()
{
    int  v[]={8,7,6,5,4,3,2,1};
    int length = sizeof(v)/sizeof(int);
//    randomArr(v,length);
    bubble(v,length);
    printArr(v,length);
    if (checkSort(v,length))
        cout<<"right"<<endl;
    else
        cout<<"wrong"<<endl;
}